/**
 * 
 */
package cn.biplam.front.template.control.rfFlowTable.callback.content;

import cn.biplam.common.tools.TOOLS;
import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.common.wrapper.Result;
import cn.biplam.common.wrapper.UserInfo;
import cn.biplam.front.callback.CallBack;
import cn.biplam.front.html.base.HtmlWindow;
import cn.biplam.front.template.base.UnFloatText;

/**
 * 基础名称回调类
 * @author 	WangSong 2009-11-5 下午02:46:34
 * @version 1.0
 */
public class BaseContentCallback implements CallBack{
	
	private String fieldName;

	/**
	 * 构造方法
	 * @param fieldName	列名
	 */
	public BaseContentCallback(String fieldName){
		this.fieldName=fieldName;
	}

	public HtmlWindow[] getGroup(Result data, String homeUrl, UserInfo user)
			throws ErrorMessage {
		HtmlWindow[] pk=new HtmlWindow[1];
		UnFloatText text=new UnFloatText(data.getString(fieldName));
		HtmlWindow typeDesc=text.get();
		int cssWidth = 4;//margin占位宽度
		typeDesc.setLength(TOOLS.getPxLength(text.getLength())+cssWidth);
		pk[0] = typeDesc ;
		return pk;
	}
}